package com.ruoyi.device.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.device.mapper.DeviceStateMapper;
import com.ruoyi.device.domain.DeviceState;
import com.ruoyi.device.service.IDeviceStateService;
import com.ruoyi.common.core.text.Convert;

/**
 * 设备状态列表Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-12-11
 */
@Service
public class DeviceStateServiceImpl implements IDeviceStateService 
{
    @Autowired
    private DeviceStateMapper deviceStateMapper;

    /**
     * 查询设备状态列表
     * 
     * @param id 设备状态列表主键
     * @return 设备状态列表
     */
    @Override
    public DeviceState selectDeviceStateById(Long id)
    {
        return deviceStateMapper.selectDeviceStateById(id);
    }

    /**
     * 查询设备状态列表列表
     * 
     * @param deviceState 设备状态列表
     * @return 设备状态列表
     */
    @Override
    public List<DeviceState> selectDeviceStateList(DeviceState deviceState)
    {
        return deviceStateMapper.selectDeviceStateList(deviceState);
    }

    /**
     * 新增设备状态列表
     * 
     * @param deviceState 设备状态列表
     * @return 结果
     */
    @Override
    public int insertDeviceState(DeviceState deviceState)
    {
        deviceState.setCreateTime(DateUtils.getNowDate());
        return deviceStateMapper.insertDeviceState(deviceState);
    }

    /**
     * 修改设备状态列表
     * 
     * @param deviceState 设备状态列表
     * @return 结果
     */
    @Override
    public int updateDeviceState(DeviceState deviceState)
    {
        deviceState.setUpdateTime(DateUtils.getNowDate());
        return deviceStateMapper.updateDeviceState(deviceState);
    }

    /**
     * 批量删除设备状态列表
     * 
     * @param ids 需要删除的设备状态列表主键
     * @return 结果
     */
    @Override
    public int deleteDeviceStateByIds(String ids)
    {
        return deviceStateMapper.deleteDeviceStateByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除设备状态列表信息
     * 
     * @param id 设备状态列表主键
     * @return 结果
     */
    @Override
    public int deleteDeviceStateById(Long id)
    {
        return deviceStateMapper.deleteDeviceStateById(id);
    }
}
